exports.main = async (event, context) => {
  try {
    const db = uniCloud.database()
    const res = await db.collection('questions').get()

    return {
      code: 200,
      data: res.data,
      msg: 'success'
    }
  } catch (err) {
    console.error('云函数错误:', err)
    return {
      code: 500,
      msg: '服务器错误'
    }
  }
}